<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //定义数组对象
        let obj = [
            {
                uname: '小鹏',
                age: 18
            },
            {
                uname: '小刘',
                age: 18
            },
            {
                uname: '小阳',
                age: 18
            }
        ]
        // 遍历数组对象，key表示索引，item表示每一项
        for (let [key, item] of obj.entries()) {
            console.log(item.uname);
            console.log(item.age);
        }
    </script>
</body>

</html>